import React from 'react';

const detail = React.lazy(() => import('../views/detail'))
const home = React.lazy(() => import('../views/home'))
const layout = React.lazy(() => import('../views/layout'))
const my = React.lazy(() => import('../views/my'))
const login = React.lazy(() => import('../views/login'))

export interface RouteRaw {
	path: string
	element: React.FC,
	title?: string
	children?: RouteRaw[]
}

export const childrenRoutes: RouteRaw[] = [{
	path: '/',
	element: home,
	title: '首页'
}, {
	path: '/my',
	element: my,
	title: '我的'
}]

export const routes: RouteRaw[] = [{
	path: '/detail/:id',
	element: detail,
}, {
	path: '/',
	element: layout,
	children: childrenRoutes
}, {
	path: '/login',
	element: login
}]


